package com.soup.lab.spring.web.controller;


import com.soup.lab.spring.web.enums.StateEnum;
import com.soup.lab.spring.web.tools.enums.validation.EnumCode;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v")
@Validated
public class ValidationController {

    @RequestMapping("/a")
    public String validate(@EnumCode(value = StateEnum.class, message = "状态错误") String state) {
        return state;
    }

}
